package com.example.sql.manager.controller;

import com.example.sql.manager.constants.Url;
import com.example.sql.manager.service.FuncService;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import springfox.documentation.annotations.ApiIgnore;

import javax.annotation.Resource;

@ApiIgnore
@Controller
@RequestMapping(Url.PAGE)
public class PageController {

    @Resource
    private FuncService funcService;

    @GetMapping("/sql-submit")
    public String sqlSubmit() {
        //提交sql页面
        return "sql-submit";
    }

    @GetMapping("/sql-list")
    public String sqlList(ModelMap modelMap) {
        modelMap.addAttribute("sqlList", funcService.sqlList());
        //sql列表页面
        return "sql-list";
    }

}
